import Vue from 'vue'

import Cookies from 'js-cookie'

import Element from 'element-ui'
import './assets/styles/element-variables.scss'

import 'umy-ui/lib/theme-chalk/index.css';// 引入样式

import '@/assets/styles/index.scss' // global css
import '@/assets/styles/ruoyi.scss' // ruoyi css
import App from './App'
import store from './store'
import router from './router'
import directive from './directive' // directive
import plugins from './plugins' // plugins
import { download, downExport,downloadformData } from '@/utils/request'
// 引入防抖节流函数文件
import { debounce, throttle } from './utils/dbucTrtl.js';
// 在Vue实例上扩展全局方法
Vue.prototype.$debounce = debounce;
Vue.prototype.$throttle = throttle;



import './assets/icons' // icon
import './permission' // permission control
import { getDicts } from "@/api/system/dict/data";
import { getConfigKey } from "@/api/system/config";
import { stateFormat,PerseFormat,numberFormat,parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree,twoFixed, noFixed} from "@/utils/ruoyi";
// 分页组件
import Pagination from "@/components/Pagination";
// 自定义表格工具组件
import RightToolbar from "@/components/RightToolbar"
// 富文本组件
import Editor from "@/components/Editor"
// 文件上传组件
import FileUpload from "@/components/FileUpload"
// 图片上传组件
import ImageUpload from "@/components/ImageUpload"
// 图片预览组件-相对路径
import ImagePreview from "@/components/ImagePreview"
// 全路径
import ImagePreviewFull from "@/components/ImagePreviewFull"
// 全路径
import ImagePopoverFull from "@/components/ImagePopoverFull"
// 字典标签组件
import DictTag from '@/components/DictTag'
// 头部标签组件
import VueMeta from 'vue-meta'
// 字典数据组件
import DictData from '@/components/DictData'
//提示词编辑
import handlepopover from "@/views/components/mypopover/edit.vue";
//提示词form编辑
import handleform from "@/views/components/mypopover/form.vue";
import mypopover from "@/views/components/mypopover/index.vue";
import onerow from "@/views/components/mypopover/onerow.vue";
// 封装导入组件
import uploadFile from "@/views/components/uploadFile/index.vue";
// 封装店铺id导入组件
import uploadFileShopid from "@/views/components/uploadFileShopid/index.vue";
// 封装时间段组件
import timeRange from "@/views/components/timeRange/index.vue";
// vform 表单设计器
import vform from '@/components/vform/VFormDesigner.umd.min.js'
import '@/components/vform/VFormDesigner.css'


import DrawFlow from "@/components/DrawFlow";
Vue.use(DrawFlow);

import dataV from '@jiaminghi/data-view'
// import '@/assets/style/reset.css'
// import '@/assets/style/common.min.css'
// import '@/assets/style/base.min.css'
// import 'amfe-flexible/index'
Vue.use(dataV)


import Viser from 'viser-vue'
Vue.use(Viser)

//vue2-org-tree
import Vue2OrgTree from 'vue2-org-tree'
 import './org-tree.scss'
Vue.use(Vue2OrgTree)
//流程图
import SuperFlow from 'vue-super-flow'
import 'vue-super-flow/lib/index.css'

Vue.use(SuperFlow)

// import VueSse from 'vue-sse';
 
// Vue.use(VueSse);


// // 隐藏 右侧浏览器 滚动条
// import VueSmoothScroll from "vue2-smooth-scroll";
// Vue.use(VueSmoothScroll)





// import VueDraggableResizable from 'vue-draggable-resizable'
// import "vue-draggable-resizable/dist/VueDraggableResizable.css";
// Vue.component('vue-draggable-resizable', VueDraggableResizable)

//
import dayjs from 'dayjs'
Vue.prototype.$dayjs = dayjs
import 'echarts/theme/macarons.js'

import VCharts from 'v-charts-v2'
// import VCharts from 'v-charts'
Vue.use(VCharts)
import 'v-charts/lib/style.css';
import VeBar from 'v-charts/lib/bar' // 条形图
import VeRadar from 'v-charts/lib/radar' // 雷达
import VeHistogram from 'v-charts/lib/histogram' // 柱状图
import VeRing from 'v-charts/lib/ring' // 环形
import VePie from 'v-charts/lib/pie' // 饼图

Vue.component(VeBar.name, VeBar)
Vue.component(VeRadar.name, VeRadar)
Vue.component(VeHistogram.name, VeHistogram)
Vue.component(VeRing.name, VeRing)
Vue.component(VePie.name, VePie)
//main.js 引入echarts
import * as echarts from 'echarts';
Vue.prototype.$echarts = echarts



import {
  UTable, UTableColumn, UxGrid,
  UxTableColumn
} from 'umy-ui';
// import tableHeight from '@/directive/root.js'
// // 表格自适应指令
// Vue.use(tableHeight)

// 全局方法挂载
Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey
Vue.prototype.parseTime = parseTime
Vue.prototype.stateFormat = stateFormat
Vue.prototype.numberFormat = numberFormat
Vue.prototype.PerseFormat =PerseFormat


Vue.prototype.resetForm = resetForm
Vue.prototype.addDateRange = addDateRange

Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.selectDictLabels = selectDictLabels
Vue.prototype.download = download
Vue.prototype.downExport = downExport
Vue.prototype.downloadformData = downloadformData
Vue.prototype.handleTree = handleTree
Vue.prototype.twoFixed = twoFixed
Vue.prototype.noFixed = noFixed

// 全局组件挂载
Vue.component('DictTag', DictTag)
Vue.component('Pagination', Pagination)
Vue.component('RightToolbar', RightToolbar)
Vue.component('Editor', Editor)
Vue.component('FileUpload', FileUpload)
Vue.component('ImageUpload', ImageUpload)
Vue.component('ImagePreview', ImagePreview)
Vue.component('ImagePreviewFull', ImagePreviewFull)
Vue.component('ImagePopoverFull', ImagePopoverFull)
Vue.component('handlepopover', handlepopover)
Vue.component('handleform', handleform)
Vue.component('mypopover', mypopover)
Vue.component('onerow', onerow)
Vue.component('uploadFile', uploadFile)
Vue.component('uploadFileShopid', uploadFileShopid)

Vue.component('timeRange', timeRange)



//作者：tony / ruoyi-flowable
import Tinymce from '@/components/tinymce/index.vue'
  
Vue.component('tinymce', Tinymce)

//同时注册了v-form-designer、v-form-render等组件
Vue.use(vform)

//引入modelerStore
import modelerStore from '@/components/Process/common/global'
//全局挂载modelerStore
Vue.prototype.modelerStore = modelerStore

Vue.component(UTable.name, UTable);
Vue.component(UTableColumn.name, UTableColumn);
Vue.use(UxGrid);
Vue.use(UxTableColumn);

Vue.use(directive)
Vue.use(plugins)
Vue.use(VueMeta)
DictData.install()

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online! ! !
 */


Vue.use(Element, {
  size: Cookies.get('size') || 'medium' // set element-ui default size
})

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
